<template>
  <div>全局事件</div>
</template>

<script>
export default {
  mounted() {
    window.addEventListener('click', this.clickHandler, false)
  },
  methods: {
    clickHandler($event) {
      window.console.log($event)
    }
  },
  beforeDestroy() {
    window.removeEventListener('click', this.clickHandler, false)
  }
}
</script>
